/* SPDX-License-Identifier: GPL-2.0-only */
// sgm4154x Charger Driver
// Copyright (C) 2021 Texas Instruments Incorporated - http://www.sg-micro.com

#ifndef __BSP_SGM4154x_CHARGER_2_H__
#define __BSP_SGM4154x_CHARGER_2_H__

#include "bsp_sgm415xx.h"

#include <stdint.h>
#include <stdbool.h>

#define  SGM4154X_DEVICE_ADDR_2   0x1A  /* 设备地址 */



int sgm4154x_read_reg_2(uint8_t reg, uint8_t *data);
int sgm4154x_write_reg_2(uint8_t reg, uint8_t val);

int sgm415xx_channel_set_ichrg_curr_2(uint8_t chanl,uint32_t I_uA);

int sgm4154x_get_state_2(struct sgm4154x_state *state);
int sgm4154x_charging_switch_2(bool enable);


int sgm4154x_hw_chipid_detect_2(void);

int sgm4154x_switch_channel_charge_2(uint8_t chnl,bool enable);
void all_channel_charge_enable_2(void);

void sgm415xx_all_channel_init_2(uint32_t I_uA);
void sgm415xx_err_pro_2(void);
int sgm415xx_channel_init_2(uint8_t chanl,uint32_t I_uA);
int sgm4154x_get_chrg_stat_2(uint8_t *stat);

int sgm4154x_hw_init_2(uint32_t I_uA, uint32_t vindpm);

int sgm4154x_get_ichg_curr_2(void);

int sgm4154x_set_JEITA_VSET_H_state_2(uint8_t en);

int sgm4154x_set_input_volt_lim_2(unsigned int vindpm);
int sgm4154x_set_ichrg_curr_2(unsigned int uA);

#endif /* __BSP_SGM4154x_CHARGER_2_H__ */
